/**
 *
 */
package com.example.testjsbridgedemo.util;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.util.TypedValue;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.example.testjsbridgedemo.R;

//import com.sunboxsoft.guangdongVUEtest.R;

public class ToastUtil {

    public static void show(Context context, int info) {
        Toast.makeText(context, info, Toast.LENGTH_LONG).show();
    }

    public static void show(Context context, String info) {
        Toast.makeText(context, info, Toast.LENGTH_LONG).show();
    }

    public static void showDefault(Context context, String info) {
        Toast.makeText(context, info, Toast.LENGTH_LONG).show();
    }

    public static void showDefault(Context context, int info) {
        Toast.makeText(context, info, Toast.LENGTH_LONG).show();
    }

    public static void showDefaultShort(Context context, String info) {
        Toast.makeText(context, info, Toast.LENGTH_SHORT).show();
    }

    static Handler handler = new Handler(Looper.getMainLooper());

//    public static void showUIThreadInMiddle(final Context context, final String info) {
//
//        handler.post(new Runnable() {
//            @Override
//            public void run() {
////                Toast.makeText(context, info, Toast.LENGTH_LONG).show();
//                showMiddleMsg(context,info);
//            }
//        });
//    }

//
//    public static void showMiddleMsg(Context mContext, String info) {
//        Toast toast = Toast.makeText(mContext,
//                info, Toast.LENGTH_SHORT);
//        toast.setGravity(Gravity.CENTER, 0, 0);
//        LinearLayout toastView = (LinearLayout) toast.getView();
//        TextView messageTextView = (TextView) toastView.getChildAt(0);
//        messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mContext.getResources().getDimensionPixelSize(R.dimen.front_large2));
////        ImageView imageCodeProject = new ImageView(mContext);
////        imageCodeProject.setImageResource(R.drawable.ic_clear2);
////        toastView.addView(imageCodeProject, 0);
//        toast.show();
//    }
}
